home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr44 / speller2.zip / XMS.H < prev   
C/C++ Source or Header  |  1995-02-06  |  3KB  |  87 lines

  1. #if defined (_MSC_VER) 
  2. #define _Cdecl __cdecl
  3. #endif
  4.  
  5. #if !defined (XMS_H)
  6. #define XMS_H
  7.  
  8. #ifdef __cplusplus
  9. extern "C"{
  10. #endif
  11.  
  12.  
  13.     enum error {                            // XMS error codes ...
  14.         NOT_IMPLEMENTED                     = 0x80,
  15.         VDISK_DETECTED                      = 0x81,
  16.         A20_ERROR                           = 0x82,
  17.         GENERAL_DRIVER_ERROR                = 0x8E,
  18.         UNRECOVERABLE_DRIVER_ERROR          = 0x8F,
  19.         NO_MORE_MEMORY                      = 0xA0,
  20.         NO_MORE_HANDLES                     = 0xA1,
  21.         BAD_HANDLE                          = 0xA2,
  22.         BAD_SRC_HANDLE                      = 0xA3,
  23.         BAD_SRC_OFFSET                      = 0xA4,
  24.         BAD_DST_HANDLE                      = 0xA5,
  25.         BAD_DST_OFFSET                      = 0xA6,
  26.         BAD_LENGTH                          = 0xA7,
  27.         OVERLAP_ERROR                       = 0xA8,
  28.         PARITY_ERROR                        = 0xA9,
  29.         BLOCK_LOCKED                        = 0xAB,
  30.         LOCK_OVERFLOW                       = 0xAC,
  31.         LOCK_FAIL                           = 0xAD
  32.     };
  33.  
  34.  
  35. typedef unsigned int XMShandle;
  36.  
  37. struct EMMMoveStruct {
  38.     unsigned long int   TransferLength;
  39.     XMShandle           SourceHandle;
  40.     unsigned long int   SourceOffset;
  41.     XMShandle           DestHandle;
  42.     unsigned long int   DestOffset;
  43. };
  44.  
  45. unsigned int far _Cdecl XMS_Setup(void);    // Initialization routine
  46.                                             // Must be called first
  47.  
  48. unsigned char far _Cdecl XMS_FreeMem(   // returns free and total extended
  49.          unsigned int far *freemem,     // free extended memory in K
  50.          unsigned int far *totmem);     // total extended memory in K
  51.  
  52. unsigned char far _Cdecl XMS_Version(   // Returns version information
  53.          unsigned int far *version,     // BCD protocol version
  54.          unsigned int far *internal,    // BCD internal version number
  55.          unsigned int far *HMA);        // Does the HMA exist?
  56.  
  57. unsigned char far _Cdecl XMS_AllocEMB(  // Allocate extended momory
  58.          unsigned int mysize,           // size in K needed
  59.          XMShandle    far *handle);     // handle for this EMB
  60.  
  61. unsigned char far _Cdecl XMS_FreeEMB(   // Release an EMB
  62.          XMShandle    handle);          // handle to release
  63.  
  64. unsigned char far _Cdecl XMS_MoveEMB(       // Move between real memory and
  65.          struct EMMMoveStruct far *MoveRec);// extended memory.
  66.  
  67. unsigned char far _Cdecl XMS_LockEMB(   // make sure a memory block doesn't
  68.          XMShandle    handle,           // move.
  69.          void far *address);    // LINEAR memory address for this block
  70.  
  71. unsigned char far _Cdecl XMS_UnlockEMB( // unlock
  72.          XMShandle    handle);
  73.  
  74. unsigned char far _Cdecl XMS_GetEMBHandleInfo(   // info on a handle
  75.          XMShandle    handle,               // handle info wanted on
  76.          unsigned char far *LockCount,      // number of locks enabled
  77.          unsigned char far *EMBHandlesFree, // total handles free in system
  78.          unsigned int far *EMBlength);      // size of this handle in K
  79.  
  80. unsigned char far _Cdecl XMS_ReallocEMB(    // Try to change the size of
  81.          XMShandle    handle,               // this block.
  82.          unsigned int newsize);             // new size in K
  83. #ifdef __cplusplus
  84. }
  85. #endif
  86. #endif // XMS_H
  87.